
def div(a, b):
    try:
        print(a / b)
    except ZeroDivisionError:
        print('b cannot be zero')
    except Exception as e:
        print('unexpected error: {}'.format(e))
    finally:
        print('finally')
    print('finished!')


div(2, 0)
div(2, 'bad type')
div(1, 2)

